cast array to object php

40

$object = (object) $array;
$object = json_decode(json_encode($array), FALSE);
$arrayResult = array_map(function($array){
    return (object)$array;
}, $yourOrinalArray);
$object = (object)$array;

Comments

Submit
0 Comments